<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@page import="model.pojo.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
    <%
    User po = (User)request.getAttribute("profileOwner");
            request.setAttribute("pageTitle", po.getDisplayName() + "'s Profile");
    %>
    <%@ include file="/WEB-INF/jspf/header.jspf"%>
    <%
            if (request.getAttribute("userProfile") != null) {
                UserProfile up = (UserProfile) request.getAttribute("userProfile");
    %>
    <div class="portion"> 
    <form action="saveProfileChanges.do" method="POST">    
        <table border="0">
            <tbody>
                <tr>
                    <td>Profile Picture</td>
                    <td>
                        <%
        if (up.getPhotoLink() == null) {
            up.setPhotoLink("");
        }
        if (up.getPhotoLink().equals("")) {
                        %>
                        <img src="./images/defualtProfileLogo.gif">
                        <%                    } else {
                        %>
                        <img src="<%=up.getPhotoLink()%>">
                        <%
        }
                        %>
                    </td>
                </tr>
                <tr>
                    <td>Display Name</td>
                    <td><%=po.getDisplayName()%></td>
                </tr>
                <tr>
                    <td>Age</td>
                    <td><%
        if (up.getAge() > 0) {
            out.print(up.getAge());
        } else {
            out.print("not set yet");
        }
                               %></td>
                </tr>
                <tr>
                    <td>Gender</td>
                    <td>                    <%
        if (up.getGender() == null) {
            up.setGender("");
        }
        if (up.getGender().equals("male")) {
                            %>
                            Male
                            <%                        } else if (up.getGender().equals("female")) {
                            %>
                            Female
                            <%        } else {
                            %>
                            not set yet
                            <%                        }
                            %>
                    </td>
                </tr>
                <tr>
                    <td>Country</td>
                    <td></td>
                </tr>
                
                <tr>
                    <td>About You</td>
                    <td>
                        <%if (up.getAboutMe() == null) {
            up.setAboutMe("");
        }%>
            <p><%=up.getAboutMe()%></p>
                    </td>
                </tr>
                <tr>
                    <td>Introduction of Your Self</td>
                    <td>
                        <%if (up.getMyInterest() == null) {
            up.setMyInterest("");
        }%>
                        <p><%=up.getMyInterest()%></p>
                    </td>
                </tr>
                <tr>
                    <td>Intro Video</td>
                    <td>
                        <%
        if (up.getVideoLink() == null) {
            up.setVideoLink("");
        }
        if (!up.getVideoLink().equals("")) {
                        %>
                        <%=up.getVideoLink()%>
                        <%
                        } else {
                        %>
                        no video code uploaded yet.
                        <%        }
                        %>
                    </td>
                </tr>
            </tbody>
        </table> 
    </form>
</div>
    <%    } else {
    %>
    <div class="error"> 
    Error... Please tell the Admins!
</div>
    <%            }
    %>
    <%@ include file="/WEB-INF/jspf/footer.jspf"%>
</html>